package com.ar.droid;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;

import com.sys_con.ColdFusion.*;


public class ManagingKeys {
	GnuPG gpg;
	public ManagingKeys(){
		
		 gpg= new GnuPG("/usr/bin/gpg");
	 		
	
		
	}
	public String createKeypair( String name, String comment, String email, String expireDate, String passphrase) throws IOException{
	//creamos la keypair
	 String key= gpg.newKey(name, comment, email, expireDate, passphrase);

	 // String key= mk.exportKey(keyID);
	
	
	 return key;
	
	}
	
	public String exportKey(String keyID){
		
		String key=gpg.getPublicKey(keyID);
		return key;
	}
	
	public String importKey(String key){
		
		String result= gpg.importKey(key);
		
	    return result;
	}
	
	public String listPublicKey(){
		String result= gpg.listKeys();
		
		return result;
		
	}
	
	public String listSecretKeys(){
		String result= gpg.listSecretKeys();
		
		return result;
		
	}
	
	public String listSignatures(){
		String result= gpg.listSigs();
		
		return result;
		
	}

	}
	


